
<? if (!$this->cart->contents()): ?>
    <p class="msg">giỏ hàng không có sản phẩm nào.</p>
    <div class="clear"></div>
    <div class="ds-sanpham">
    <? else: ?>
        <? echo form_open('gio_hang/update_remove_order'); ?>
        <div class="gio-hang" style="width: 100%">
            <div style="width: 963px; height: 25px; line-height: 25px; background: #5B6F18; color: white; padding-left: 10px; font-family: Times New Roman; font-weight: bold; font-size: 18px;">Giỏ hàng</div>
            <table class="table-cart">
                <tr class="cart-head">
                    <th>Tên sản phẩm</th>
                    <th>Ảnh sản phẩm</th>
                    <th style="text-align: center">Số lượng</th>
                    <th style="text-align: center">Giá</th>
                    <th style="text-align: right">Tổng tiền</th>
                    <th>Tác vụ</th>
                </tr>
                <? $i = 1; ?>
                <?php foreach ($this->cart->contents() as $items): ?>
                    <?php echo form_hidden($i . '[rowid]', $items['rowid']); ?>
                    <tr class="body-cart">
                        <td>
                            <?php echo $items['name']; ?>
                        </td>
                        <td><img src="<?= base_url(); ?>images/sanpham/<? echo $items['img']; ?>" width="60" height="60"/></td>
                        <? $opt = array('1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, '6' => 6, '7' => 7, '8' => 8, '9' => 9, '10' => 10); ?>
                        <td style="text-align: center"><?php echo form_dropdown($i . '[qty]', $opt, $items['qty']); ?></td>
                        <td style="text-align: right"><?php echo $this->cart->format_number($items['price']); ?> VND</td>
                        <td style="text-align: right"><?php echo $this->cart->format_number($items['subtotal']); ?> VND</td>
                        <td><a href="<?= site_url('gio_hang/delete/' . $items['rowid']); ?>"><img src="<?= base_url(); ?>images/Delete-icon.png"/></a>
                        </td>
                    </tr>
                    <? $i++; ?>
                <?php endforeach; ?>
            </table>
            <div class="subtotal">
                <div class="giaTien">Số tiền cần trả: <?php echo $this->cart->format_number($this->cart->total()); ?> VND</div>
                <div class="clear"></div>
            </div>
            <div class="clear"></div>
            <div class="button_cart">
                <?php echo form_submit('update', 'Cập nhật'); ?>&nbsp;&nbsp;
                <? echo form_submit('remove', 'Xóa giỏ hàng'); ?>&nbsp;&nbsp;
                <? echo form_submit('check_out', 'đặt hàng'); ?>
            </div>
            <? echo form_close(); ?>
        <? endif; ?>
    </div>
    <div>
    </div>
    <? if ($spxn): ?>
        <div id="SpXN">
            <h2 class="cat-name">Sản phẩm xem nhiều</h2>
            <? foreach ($spxn as $row) : ?>
                <div class="box">
                    <div class="ProductCells">
                        <a href="<? echo site_url('chi-tiet/' . $row->FSlug . '-' . $row->FID); ?>"><img class="lazy" src="<? echo base_url(); ?>images/sanpham/<?= $row->FPicture ?>" width="170" height="199"/></a>
                        <div class="text"><a class="link_text"><?= $row->FName ?></a></div>
                        <div class="price"><?= format_price($row->FPrice, 'đ') ?></div>
                    </div>
                </div>
            <? endforeach; ?>
            <div class="clear"></div>
        </div>
    <? endif; ?>
</div>